package com.xone.xapp;

import android.content.Context;
import android.webkit.WebView;

public class Constants {
	
	/**
	 * 访问地址
	 */
//	public static final String APP_URL = "http://121.199.16.115/xone-app";
	public static final String APP_URL = "http://192.168.1.37:8080/xone-app";
//	public static final String APP_URL = "http://10.0.2.2:8080/xone-app";//本地模拟器访问地址
//	public static final String APP_URL = "http://130.234.1.231:8080/xone-app";
	public static final String CUSTOMER_TEL = "4008979727";
	
	/**
	 * 请求的UserAgent
	 */
	public static final String USER_AGENT_TAG = " ZHANGCHANG.CO.,LTD.";
	
	private static String USER_AGENT = null;
	
	public static final int NUM_OF_COLUMNS = 3;
	
	public static final int GRID_PADDING = 8; // in dp
	
	/**
	 * 首页广告的切换频率
	 */
	public static final int ADVERTISEMENT_INTERVAL = 5;//单位：秒
	
	/**
	 * 各页面下的横幅广告切换间隔
	 */
	public static final int BANNER_INTERVAL = 5;//单位：秒
	
	/**
	 * 多条消息的相互间隔时间
	 */
	public final static int SUBSCRIBE_MUTIL_INTERVAL_TIME = 1500;//1.5s
	
	/**
	 * 最后一次的订阅时间
	 */
	public final static String LAST_SUBSCRIBE_DATE_KEY = "LAST_SUBSCRIBE_DATE";
	
	/**
	 * 订阅的相隔时间
	 */
	public final static int SUBSCRIBE_TIMEOUT = 48 * 60;//48 * 60;//客户要求两天推送一次
	
	/**
	 * 订阅服务的广播过滤标识
	 */
	public final static String BROADCAST_SERVICE_ACTION = "com.xone.xapp.broadcast.START_SERVICE_ACTION";
	
	public static void USER_AGENT(Context context) {
		if (null == USER_AGENT) {
			USER_AGENT = new WebView(context).getSettings().getUserAgentString();
		}
	}
	
	public static String USER_AGENT() {
		if (null == USER_AGENT) {
			return "Mozilla/5.0 (Linux; U; Android 4.1.2; zh-cn; MI-ONE Plus Build/JZO54K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30";
		}
		return USER_AGENT;
	}

}
